<?php /* Smarty version 2.6.20, created on 2017-04-12 22:24:36
         compiled from shop_wap_order.htm */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'shop_wap_order.htm', 73, false),)), $this); ?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>选择支付</title>
    <script type="text/javascript" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/templates/wap/js/jquery-min.js"></script>
    <link type="text/css" href="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/templates/wap/new_css/indexamazeui.css" rel="stylesheet" />
    <link type="text/css" href="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/templates/wap/new_css/m_base.css" rel="stylesheet" />
    <link type="text/css" href="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/templates/wap/new_css/style.css" rel="stylesheet" />
    <link type="text/css" href="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/templates/wap/new_css/order.css" rel="stylesheet" />
    <style>
        .order_msg .li_jg span{ padding-right:30px;}
        .order_msg .li_jg span.gray strong{ color: #333;}
.order_msgn {display: block;margin: 0 10px;padding-top: 10px;}
    </style>
</head>
<body>
    <style>
.header_top {
    height: 50px;
    padding: 10px;
    position: relative;
    border-bottom: 1px solid #f37b1d;
    box-shadow: 0 -1px 1px #eee;
    background: #F85709;
}
.st_back {
    position: absolute;
    left: 10px;
    width: 30px;
    height: 30px;
}
.st_back a {
    float: left;
    width: 30px;
    height: 24px;
    margin-top: 3px;
    background: url(<?php echo $this->_tpl_vars['config']['weburl']; ?>
/templates/wap/images/st_user_ico.png) no-repeat 0 0;
    background-size: 355px auto;

}
.header_top .tit {
    padding: 0;
    margin: 0;
    color: #fff;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 500;
}
</style>
<div class="home_top clearfix header_top">
       <div class="st_back"><a href="javascript:;" onclick="javascript:history.go(-1);"></a></div>
        <h1 class="tit">选择支付</h1>
    <div class="user_login">
            <a class="" href="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/login.php">登录/</a>
       <a class="" href="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/register.php">注册</a>
           </div>
  </div>

    <div class="m-main">

<div class="buy-details-hd">
            <h2 id="show_name"><?php echo $this->_tpl_vars['de']['pname']; ?>
</h2>
     </div>
    
    <ul class="order_msg">
             <li><em>单价：</em><?php echo $this->_tpl_vars['param']['product_price']; ?>
</li>
        <li><em>运费：</em><?php echo $this->_tpl_vars['param']['logistics']; ?>
</li>
                 <li><em>数量：</em><?php echo $this->_tpl_vars['param']['num']; ?>
</li>
 <li><em>日期：</em><?php echo ((is_array($_tmp=$this->_tpl_vars['de']['performance_start_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d %H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d %H:%M:%S")); ?>
</li>
 <li><em>姓名：</em><?php echo $this->_tpl_vars['param']['ship_name']; ?>
</li>
 <li><em>手机：</em><?php echo $this->_tpl_vars['param']['ship_mobile']; ?>
</li>
 <li><em>地址：</em><?php echo $this->_tpl_vars['param']['ship_addr']; ?>
</li>
    <li class="li_jg">
            <span><em>支付金额：</em><strong>&yen;<?php echo $this->_tpl_vars['param']['total_price']; ?>
</strong></span>
        </li>
    </ul>
        <div class="show-list-js">
    <div class="zhifu-box">
      <h3>选择支付方式：</h3>
        <p>
          <a  data-value="wechatpay" href="javascript:;" id="weixin_btn"><em class="hc">微信支付</em></a>
            <a data-value="alipay" href="javascript:;"><em class="zfb">支付宝</em></a></p>
      </div>
    </div>

  <form method="post" action="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/?m=product&s=shop_wap_order" id="payfrm">
      <input type="hidden" name="act" value="order"/>
      <input type="hidden" name="product_id" value="<?php echo $this->_tpl_vars['de']['id']; ?>
" />
      <input type="hidden" name="num" id="num" value="<?php echo $this->_tpl_vars['param']['num']; ?>
" />
      <input type="hidden" name="ship_name" id="ship_name" value="<?php echo $this->_tpl_vars['param']['ship_name']; ?>
" />
      <input type="hidden" name="ship_mobile" id="ship_mobile" value="<?php echo $this->_tpl_vars['param']['ship_mobile']; ?>
" />
      <input type="hidden" name="provinceid" id="provinceid" value="<?php echo $this->_tpl_vars['param']['provinceid']; ?>
" />
      <input type="hidden" name="cityid" id="cityid" value="<?php echo $this->_tpl_vars['param']['cityid']; ?>
" />
      <input type="hidden" name="areaid" id="areaid" value="<?php echo $this->_tpl_vars['param']['areaid']; ?>
" />
      <input type="hidden" name="ship_addr" id="ship_addr" value="<?php echo $this->_tpl_vars['param']['ship_addr']; ?>
" />
      <input type="hidden" name="paytype" id="paytype" value="" />
      <input type="hidden" name="delivery_way" id="delivery_way" value="<?php echo $this->_tpl_vars['param']['delivery_way']; ?>
"/>

      </form>
    <div class="bom_fix_box">

  <a class="booking" href="javascript:;">确认支付</a>
    </div>
  
    
  </div>
<script>
    $(function(){
        $('.zhifu-box').find('a').click(function(){
                $(this).addClass('on').siblings().removeClass('on');
                $("#paytype").val($(this).attr('data-value'));
        })
        $('.booking').click(function(){
            var ship_name = $("#ship_name").val();
            var ship_mobile = $("#ship_mobile").val();
            var provinceid = $("#provinceid").val();
            var cityid = $("#cityid").val();
            var areaid = $("#areaid").val();
            var ship_addr = $("#ship_addr").val();
            var paytype = $("#paytype").val();
            var delivery_way = $("#delivery_way").val();

            if(ship_name == ''){
                alert("请填写姓名");
                return false;
            } else if(ship_mobile == '') {
                alert("请填写手机号码");
                return false;
            } else if(provinceid == '') {
                alert("请选择省");
                return false;
            } else if(cityid == '') {
                alert("请选择市");
                return false;
            } else if(areaid == '') {
                alert("请选择区");
                return false;
            } else if(ship_addr == '') {
                alert("请填写详细地址");
                return false;
            } else if(paytype == '') {
                alert("请选择支付方式");
                return false;
            } else if(delivery_way == '') {
                alert("请选择配送方式");
                return false;
            } else {
                   $("#payfrm").submit();
            }



        })
        if(!isWeiXin())
    {
        //    $("#weixin_btn").hide();
$("#weixin_btn").siblings('a:first').addClass('on');
            $("#paytype").val($("#weixin_btn").siblings('a:first').attr("data-value"));
    }
    })

function isWeiXin(){ 
var ua = window.navigator.userAgent.toLowerCase(); 
if(ua.match(/MicroMessenger/i) == 'micromessenger'){ 
return true; 
}else{ 
return false; 
} 
} 
</script>
 
</body>
</html>